package com.剑指offer.no05;

import java.lang.reflect.Array;
import java.util.*;

public class Solution {
    public String replaceSpace(String s) {
        if (s.length() == 0) {
            return "";
        }

        StringBuilder result = new StringBuilder();

        for (int i = 0; i <= s.length() - 1; i++) {
            if (' ' == s.charAt(i)) {
                result.append("%20");
            } else {
                result.append(s.charAt(i));
            }
        }
        return result.toString();
    }
}
